Linux Oracle 11g, lsnrctl start 监听服务启动失败解决办法

您所在的位置:网站首页 oracle lsnrctl Linux Oracle 11g, lsnrctl start 监听服务启动失败解决办法

Linux Oracle 11g, lsnrctl start 监听服务启动失败解决办法

2023-03-11 02:44| 来源: 网络整理| 查看: 265

Linux Oracle 11g, lsnrctl start 监听服务启动失败解决办法 原创

990487026 2016-08-29 10:57:57 博主文章分类:Linux 开发 ©著作权

文章标签 Oracle Linux lsnrctl 文章分类 Oracle 数据库

©著作权归作者所有:来自51CTO博客作者990487026的原创作品,谢绝转载,否则将追究法律责任

【本文谢绝转载原文来自http://990487026.blog.51cto.com】

报错的现象:

[oracle@oracle11 ~]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-AUG-2016 10:38:59 Copyright (c) 1991, 2009, Oracle.  All rights reserved. Starting /opt/oracle/app/product/11.2.0/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /opt/oracle/app/product/11.2.0/dbhome_1/network/admin/listener.ora Log messages written to /opt/oracle/app/diag/tnslsnr/oracle11/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle11)(PORT=1521))) TNS-12545: Connect failed because target host or object does not exist  TNS-12560: TNS:protocol adapter error   TNS-00515: Connect failed because target host or object does not exist Listener failed to start. See the error message(s) above...

以上是报错信息.

开始查错,

查到了TNS-12545: Connect failed because target host or object does not exist

[oracle@oracle11 ~]$ > /opt/oracle/app/diag/tnslsnr/oracle11/listener/alert/log.xml [oracle@oracle11 ~]$ lsnrctl start [oracle@oracle11 ~]$ grep txt  /opt/oracle/app/diag/tnslsnr/oracle11/listener/alert/log.xml  System parameter file is /opt/oracle/app/product/11.2.0/dbhome_1/network/admin/listener.ora  Log messages written to /opt/oracle/app/diag/tnslsnr/oracle11/listener/alert/log.xml  Trace information written to /opt/oracle/app/diag/tnslsnr/oracle11/listener/trace/ora_3706_140351658579712.trc  Trace level is currently 0  Started with pid=3706  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))  Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle11)(PORT=1521)))  TNS-12545: Connect failed because target host or object does not exist  No longer listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) [oracle@oracle11 ~]$

网上查[TNS-12545: Connect failed] 找到tnsnames.ora文件

cat /opt/oracle/app/product/11.2.0/dbhome_1/network/admin/tnsnames.ora # tnsnames.ora Network Configuration File: /opt/oracle/app/product/11.2.0/dbhome_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ORCL =   (DESCRIPTION =     (ADDRESS = (PROTOCOL = TCP)(HOST = oracle11)(PORT = 1521))     (CONNECT_DATA =       (SERVER = DEDICATED)       (SERVICE_NAME = orcl)     )   )

看到:HOST = oracle11

查看我的hosts文件,真的没有这个:

[oracle@oracle11 ~]$ cat /etc/hosts 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 [oracle@oracle11 ~]$

添加一条:

[oracle@oracle11 ~]$ su root Password:  [root@oracle11 oracle]# echo "127.0.0.1 oracle11 " >> /etc/hosts [root@oracle11 oracle]# cat /etc/hosts 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 oracle11  [root@oracle11 oracle]#

访问测试:,启动监听:

[oracle@oracle11 ~]$ ping oracle11 PING oracle11 (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.090 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.048 ms 64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.046 ms [oracle@oracle11 ~]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-AUG-2016 10:47:44 Copyright (c) 1991, 2009, Oracle.  All rights reserved. Starting /opt/oracle/app/product/11.2.0/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /opt/oracle/app/product/11.2.0/dbhome_1/network/admin/listener.ora Log messages written to /opt/oracle/app/diag/tnslsnr/oracle11/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias                     LISTENER Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date                29-AUG-2016 10:47:44 Uptime                    0 days 0 hr. 0 min. 0 sec Trace Level               off Security                  ON: Local OS Authentication SNMP                      OFF Listener Parameter File   /opt/oracle/app/product/11.2.0/dbhome_1/network/admin/listener.ora Listener Log File         /opt/oracle/app/diag/tnslsnr/oracle11/listener/alert/log.xml Listening Endpoints Summary...   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11)(PORT=1521))) The listener supports no services The command completed successfully [oracle@oracle11 ~]$

scott登陆上去试一试:

我的数据库服务已经启动

[oracle@oracle11 ~]$ sqlplus scott/11 SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 29 10:48:36 2016 Copyright (c) 1982, 2009, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select * from dept;     DEPTNO DNAME   LOC ---------- -------------- ------------- 50 oracle   England 10 ACCOUNTING   NEW YORK 20 RESEARCH   DALLAS 30 SALES   CHICAGO 40 OPERATIONS   BOSTON SQL>  SQL> exit; Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@oracle11 ~]$

搞定!

收藏 评论 分享 举报

上一篇:CentOS安装Oracle11g   Linux 搭建Pro*C/C++开发环境

下一篇:数据库编程4 Oracle Pro*C/C++开发



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3